package com.fxkj.sthjt.db.controller;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fxkj.sthjt.db.mapper.JcContentMapper;

/**
 * <p>
 * huanbaocms.jc_content 前端控制器
 * </p>
 * http://localhost:7777/sthjt/jc-content/loadContent
 * 
 * @author 冯晓东
 * @since 2021-09-13
 */
@RestController
@RequestMapping("/jc-content")
public class JcContentController {

	@Autowired
	private JcContentMapper jcContentMapper;

	// 根据类目查询文章 , 与客户官网的数据进行比对
	// http://localhost:7777/sthjt/jc-content/loadContent?channelId=
	@GetMapping("/loadContent")
	public String initDatas(int channelId) {
		System.err.println("channelId-------->" + channelId);
		List<Map<String, Object>> list = jcContentMapper.selectContent(channelId);
		for (Map<String, Object> map : list) {
			System.err.println(map);
//			System.err.println(String.format("%1---%2", map.get(""), map.get("")));
		}

		String end = String.format("%s 数据条数: %s", channelId, list.size());
		System.err.println(end);
		return end;
	}
}
